<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<style>
    #photo {
        max-width: 100%;
        max-height: 350px;
    }
</style>
<body class="hold-transition skin-yellow sidebar-mini">
<!--修改密码-->
<div class="modal fade" data-backdrop="static" data-keyboard="false" id="modal-updatePassword">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改密码</h4>
            </div>
            <div class="modal-body">
                <form id="userForm" class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="pwd" class="col-sm-2 control-label no-padding-right">新的密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="pwd" name="pwd"
                                   placeholder="请输入新密码">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="rePwd" class="col-sm-2 control-label no-padding-right">重复密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="rePwd" name="rePwd"
                                   placeholder="请再输入一次">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" id="btn-updatePassword">确定</button>
            </div>
        </div>
    </div>
</div>
<!--修改头像-->
<div class="modal fade" data-backdrop="static" data-keyboard="false" id="modal-upload">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改头像</h4>
            </div>
            <div class="modal-body">
                <p class="tip-info text-center">
                    未选择图片
                </p>
                <div class="img-container hidden">
                    <img src="" alt="" id="photo">
                </div>
                <div class="img-preview-box hidden">
                    <hr>
                    <span>150*150:</span>
                    <div class="img-preview img-preview-lg">
                    </div>
                    <span>100*100:</span>
                    <div class="img-preview img-preview-md">
                    </div>
                    <span>30*30:</span>
                    <div class="img-preview img-preview-sm">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <label class="btn btn-danger pull-left" for="photoInput">
                    <input type="file" class="sr-only" id="photoInput" accept="image/*">
                    <span>打开图片</span>
                </label>
                <button type="button" class="btn btn-info disabled" disabled id="btn-upload" onclick="sendPhoto()">确定
                </button>
                <p style="color:red;margin-top: 8px;margin-left: 20px" class="pull-left">比例 1 ：1 建议尺寸 300 x 300</p>
            </div>
        </div>
    </div>
</div>

<div class="wrapper">

    <header class="main-header">
        <a class="logo">
            <span class="logo-lg"><b style="float:left">生产管理系统</b></span>
        </a>
        <nav class="navbar navbar-static-top">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" title="菜单缩放" role="button"></a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!--<li class="dropdown messages-menu">
                        <a href="#" title="项目下达任务消息提示" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-comment-o"></i>
                            <span class="label label-danger" id="count-send"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <ul class="menu" id="unread-send"></ul>
                            </li>
                            <li class="footer" id="no-send"><a href="javascript:void(0)">没有未读消息</a></li>
                        </ul>
                    </li>
                    <li class="dropdown messages-menu">
                        <a href="#" title="项目变更消息提示" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-bell-o"></i>
                            <span class="label label-danger" id="count-change"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <ul class="menu" id="unread-change"></ul>
                            </li>
                            <li class="footer" id="no-change"><a href="javascript:void(0)">没有未读消息</a></li>
                        </ul>
                    </li>
                    <li class="dropdown messages-menu">
                        <a href="#" title="互动专区消息提示" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-envelope-o"></i>
                            <span class="label label-danger" id="count-interactive"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <ul class="menu" id="unread-interactive"></ul>
                            </li>
                            <li class="footer" id="no-interactive"><a href="javascript:void(0)">没有未读消息</a></li>
                        </ul>
                    </li>-->
                    <li shiro:authenticated="true" class="dropdown user user-menu" style="width: 160px!important;">
                        <a href="#" id="account" class="dropdown-toggle" data-toggle="dropdown">
                            <img th:src="${#strings.isEmpty(session.user.avatar)}?@{/img/person.png}:${session.user.avatar}"
                                 id="userImage" class="user-image img-circle"/>
                            <span class="hidden-xs" th:text="${session.user.name}"></span>
                        </a>
                        <ul class="dropdown-menu"
                            style="margin:0!important;width: 100px!important;padding: 0!important;">
                            <!--<li style="width: 90px!important;" id="updateSign"><a style="padding: 0px" href="javascript:void(0)" class="pull-right" onclick="js.modal.open('modal-updatePassword')"><i class="fa fa-edit">&nbsp;修改头像</i></a></li>-->
                            <!--<li style="width: 90px!important;" id="updatePwd"><a style="padding: 0px"  href="javascript:void(0)" class="pull-right" onclick="js.modal.open('modal-upload')"><i class="fa fa-edit">&nbsp;修改签名</i></a></li>-->
                        </ul>
                    </li>
                    <li shiro:authenticated="true">
                        <a href="#" id="updatePassword" onclick="js.modal.open('modal-updatePassword')">
                            <i class="fa fa-edit">&nbsp;修改密码</i>
                        </a>
                    </li>
                    <li>
                        <a th:href="@{/logout}">
                            <i class="fa fa-sign-out">&nbsp;退出</i>
                        </a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>

    <aside class="main-sidebar">
        <section class="sidebar">
            <ul class="sidebar-menu" data-widget="tree">
                <!--系统总览-->
                <li shiro:hasPermission="overview:menu" class="treeview menu-open">
                    <a href="#">
                        <i class="fa fa-folder-open text-maroon"></i>
                        <span>系统总览</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu" style="display: block;">
                        <li class="active">
                            <a th:href="@{/overview/index}" shiro:hasPermission="overview:home:view" target="content">
                                <i class="fa fa-home text-orange"></i> 首页
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/overview/projectChangeQuery}" shiro:hasPermission="overview:projectChangeQuery:view" target="content">
                                <i class="fa fa-search text-green"></i> 项目变更查询
                            </a>
                        </li>
                    </ul>
                </li>
                <li shiro:hasPermission="pro:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-aqua"></i>
                        <span>生产任务管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li shiro:hasPermission="pro:release:view">
                            <a th:href="@{/prodOrd}" target="content">
                                <i class="fa fa-building text-lime"></i> 生产令下达
                                <lable id="prodOrdReleaseNum" class="label label-warning pull-right" style="display: none">0</lable>
                            </a>
                        </li>
                        <li shiro:hasPermission="pro:proStrucEdit:view">
                            <a th:href="@{/proStrucEdit}" target="content">
                                <i class="fa fa-cogs text-orange"></i> 产品结构查询
                                <lable id="prodOrdReleaseNum" class="label label-warning pull-right" style="display: none">0</lable>
                            </a>
                        </li>
                        <li shiro:hasPermission="pro:changeflag:view">
                            <a th:href="@{/proChangeFlag}" target="content">
                                <i class="fa fa-cogs text-light-blue"></i> 串料标识维护
                            </a>
                        </li>
                        <li shiro:hasPermission="pro:equipment:view">
                            <a th:href="@{/task/scheduling}" target="content">
                                <i class="fa fa-list-ol text-yellow"></i> 排产任务池
                                <lable id="schedulingNum" class="label label-warning pull-right" style="display: none">0</lable>
                            </a>
                        </li>
                        <li shiro:hasPermission="pro:other:view">
                            <a th:href="@{/task/common}" target="content">
                                <i class="fa fa-list-ul text-green"></i> 普通任务池
                                <lable id="commonNum" class="label label-warning pull-right" style="display: none">0</lable>
                            </a>
                        </li>
                        <li shiro:hasPermission="pro:proPlanCheck:view">
                            <a th:href="@{/task/audit}" target="content">
                                <i class="fa fa-check-circle text-red"></i> 排产计划科级审核
                                <lable id="auditNum" class="label label-warning pull-right" style="display: none">0</lable>
                            </a>
                        </li>
                        <li shiro:hasPermission="pro:proMinisterialPlanCheck:view">
                            <a th:href="@{/task/ministerialAudit}" target="content">
                                <i class="fa fa-check-circle text-red"></i> 排产计划部级审核
                                <lable id="auditMinisterialNum" class="label label-warning pull-right" style="display: none">0</lable>
                            </a>
                        </li>
<!--                        <li shiro:hasPermission="pro:productPlan:view">-->
<!--                            <a th:href="@{/task/factoryPlanEditAndReturn}" target="content">-->
<!--                                <i class="fa fa-pencil-square-o text-yellow"></i> 生产计划编辑反馈-->
<!--                            </a>-->
<!--                        </li>-->

                        <li shiro:hasPermission="pro:orderChange:view">
                            <a th:href="@{/prodOrd/changeQuery}" target="content">
                                <i class="fa fa-search text-green"></i> 生产令变更查询
                            </a>
                        </li>
                        <li shiro:hasPermission="pro:proPlanChange:view">
                            <a th:href="@{/task/changeQuery}" target="content">
                                <i class="fa fa-search text-green"></i> 排产计划变更查询
                            </a>
                        </li>
                        <li shiro:hasPermission="pro:proProgress:view">
                            <a th:href="@{/task/prodOrdQuery/multiple}" target="content">
                                <i class="fa fa-tasks text-aqua"></i> 生产进度看板
                            </a>
                        </li>
                        <li shiro:hasPermission="pro:masterPlan:view">
                            <a th:href="@{/task/planQuery}" target="content">
                                <i class="fa fa-search text-green"></i> 总调计划查询
                            </a>
                        </li>
                        <li shiro:hasPermission="pro:fileQuery:view">
                            <a th:href="@{/prodOrd/proFileQuery}" target="content">
                                <i class="fa fa-search text-green"></i> 项目文件查询
                            </a>
                        </li>
                    </ul>
                </li>

                <!--技术文件-->
                <li shiro:hasPermission="data:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-danger"></i>
                        <span>技术资料管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li shiro:hasPermission="data:buy:view">
                            <a th:href="@{/purch}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 外购件计划分配
                            </a>
                        </li>
                        <li shiro:hasPermission="data:makeList:view">
                            <a th:href="@{/tecmake}" target="content">
                                <i class="fa fa-scissors text-orange"></i> 制作件清单分配
                            </a>
                        </li>
<!--                        <li shiro:hasPermission="data:paintingList:view">-->
<!--                            <a th:href="@{/purch}" target="content">-->
<!--                                <i class="fa fa-eyedropper  text-yellow"></i> 涂装设计清单签收-->
<!--                            </a>-->
<!--                        </li>-->
                        <li shiro:hasPermission="data:drawing:view">
                            <a th:href="@{/tecdrawsign}" target="content">
                                <i class="fa fa-file-word-o  text-green"></i> 生产运营部图纸签收
                            </a>
                        </li>
                        <li shiro:hasPermission="draw:change:view">
                            <a th:href="@{/tecdrawsign/changSign}" target="content">
                                <i class="fa fa-stack-exchange  text-blue"></i> 生产运营部图纸变更签收
                            </a>
                        </li>
                        <li shiro:hasPermission="drawCJ:change:view">
                            <a th:href="@{/tecdrawcjsign}" target="content">
                                <i class="fa fa-book  text-navy"></i> 生产厂图纸签收
                            </a>
                        </li>
                        <li shiro:hasPermission="drawCJ:change:view">
                            <a th:href="@{/tecdrawcjsign/changSign}" target="content">
                                <i class="fa fa-american-sign-language-interpreting  text-red"></i> 生产厂图纸变更签收
                            </a>
                        </li>
                        <li shiro:hasPermission="data:proCardSign:view">
                            <a th:href="@{/tecard}" target="content">
                                <i class="fa fa-window-restore  text-aqua"></i> 工艺卡接收
                            </a>
                        </li>
                        <li shiro:hasPermission="data:proCard:view">
                            <a th:href="@{/tecard/print}" target="content">
                                <i class="fa fa-file-text  text-purple"></i> 工艺卡查询
                            </a>
                        </li>
                        <li shiro:hasPermission="data:dataSum:view">
                            <a th:href="@{/summary}" target="content">
                                <i class="fa fa-th-large  text-bold"></i> 技术资料清单汇总
                            </a>
                        </li>
                    </ul>
                </li>
                <!--生产转序管理-->
                <li shiro:hasPermission="flow:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-pink"></i>
                        <span>生产转序管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 下料任务维护
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 零件级生产任务池
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 工艺卡转序-申请质检
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 工艺卡转序-历史申请
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 工艺卡转序-质检检验
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 工艺卡转序-历史检验
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 工艺卡转序-转序接收
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 工艺卡转序-历史接收
                            </a>
                        </li>
                        <li shiro:hasPermission="flow:transquery:view">
                            <a th:href="@{/flow/transquery}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 工艺卡电子转序单查询
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 质检报废审核
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 半成品库池
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/hist/Transposition}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 半成品出入库记录
                            </a>
                        </li>
                    </ul>
                </li>
                <!--装配派工管理-->
                <li shiro:hasPermission="xxx" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-pink"></i>
                        <span>装配派工管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                </li>

                <!--发货安装管理-->
                <li shiro:hasPermission="xxx" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-pink"></i>
                        <span>发货安装管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/create/shipments}" target="content">
                                <i class="fa fa-align-justify  text-red"></i> 创建发货计划
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/create/shipmentsEdit}" target="content">
                                <i class="fa fa-scissors text-orange"></i> 发货计划编辑
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/task/common1}" target="content">
                                <i class="fa fa-eyedropper  text-yellow"></i> 创建发货清单
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/task/prodOrdQuery/single/2020L007-01}" target="content">
                                <i class="fa fa-file-word-o  text-green"></i> 发货清单查询
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/create/dispatching}" target="content">
                                <i class="fa fa-stack-exchange  text-blue"></i> 创建安装派工单
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/task/prodOrdQuery/single/2020L007-01}" target="content">
                                <i class="fa fa-window-restore  text-aqua"></i> 安装派工单提交
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/task/prodOrdQuery/single/2020L007-01}" target="content">
                                <i class="fa fa-file-text  text-purple"></i> 安装派工单审核
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/task/prodOrdQuery/single/2020L007-01}" target="content">
                                <i class="fa fa-th-large  text-bold"></i> 安装任务反馈
                            </a>
                        </li>
                        <li shiro:hasPermission="xxx">
                            <a th:href="@{/create/dispatching/debuggingPage}" target="content">
                                <i class="fa fa-th-large  text-bold"></i> 调试完工反馈
                            </a>
                        </li>
                    </ul>
                </li>


                <!--成本输出-->
                <li class="treeview" shiro:hasPermission="cost:menu">
                    <a href="#">
                        <i class="fa fa-folder-open text-aqua"></i>
                        <span>成本信息输出管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li class="treeview" shiro:hasPermission="costBlank:menu">
                            <a href="#">
                                <i class="fa fa-folder-open   text-lime"></i>
                                <span>下料工时确认单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li shiro:hasPermission="cost:Blank:view"><a th:href="@{/craft/cost/blanking/create}"
                                                                             target="content"><i
                                        class="fa fa-pencil-square  text-fuchsia"></i> 下料工时确认单录入</a></li>
                                <li shiro:hasPermission="cost:BlankList:view"><a
                                        th:href="@{/craft/cost/blanking/submit}"
                                        target="content"><i class="fa fa-bandcamp text-yellow"></i> 下料工时确认单提交</a></li>
                                <li shiro:hasPermission="cost:Blanking:view"><a
                                        th:href="@{/craft/cost/blanking/examine}"
                                        target="content"><i class="fa fa-check-circle  text-lime"></i> 下料工时确认单审核</a>
                                </li>
                            </ul>
                        </li>
                        <li class="treeview" shiro:hasPermission="costRivet:menu">
                            <a href="#">
                                <i class="fa fa-folder-open   text-lime"></i>
                                <span>铆焊工时确认单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li shiro:hasPermission="cost:rivet:view"><a th:href="@{/craft/cost/solder/create}"
                                                                             target="content"><i
                                        class="fa fa-pencil-square  text-fuchsia"></i> 铆焊工时确认单录入</a></li>
                                <li shiro:hasPermission="cost:rivetTime:view"><a th:href="@{/craft/cost/solder/submit}"
                                                                                 target="content"><i
                                        class="fa fa-bandcamp text-yellow"></i> 铆焊工时确认单提交</a></li>
                                <li shiro:hasPermission="cost:rivetList:view"><a th:href="@{/craft/cost/solder/examine}"
                                                                                 target="content"><i
                                        class="fa fa-check-circle  text-lime"></i> 铆焊工时确认单审核</a></li>
                            </ul>
                        </li>


                        <li class="treeview" shiro:hasPermission="costHeat:menu">
                            <a href="#">
                                <i class="fa fa-folder-open   text-lime"></i>
                                <span>热处理确认单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li shiro:hasPermission="cost:heat:view"><a th:href="@{/craft/cost/heat/create}"
                                                                            target="content"><i
                                        class="fa fa-pencil-square  text-fuchsia"></i> 热处理确认单录入</a></li>
                                <li shiro:hasPermission="cost:heatment:view"><a th:href="@{/craft/cost/heat/submit}"
                                                                                target="content"><i
                                        class="fa fa-bandcamp text-yellow"></i> 热处理确认单提交</a></li>
                                <li shiro:hasPermission="cost:heatList:view"><a th:href="@{/craft/cost/heat/examine}"
                                                                                target="content"><i
                                        class="fa fa-check-circle  text-lime"></i> 热处理确认单审核</a></li>
                            </ul>
                        </li>
                        <li class="treeview" shiro:hasPermission="costAssemb:menu">
                            <a href="#">
                                <i class="fa fa-folder-open   text-yellow"></i>
                                <span>装配工时确认单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li shiro:hasPermission="cost:assemb:view"><a th:href="@{/craft/cost/assembling/create}"
                                                                              target="content"><i
                                        class="fa fa-pencil-square  text-fuchsia"></i> 装配工时确认单录入</a></li>
                                <li shiro:hasPermission="cost:assembing:view"><a
                                        th:href="@{/craft/cost/assembling/submit}"
                                        target="content"><i class="fa fa-bandcamp text-yellow"></i> 装配工时确认单提交</a></li>
                                <li shiro:hasPermission="cost:assembList:view"><a
                                        th:href="@{/craft/cost/assembling/examine}"
                                        target="content"><i class="fa fa-check-circle  text-lime"></i> 装配工时确认单审核</a>
                                </li>
                            </ul>
                        </li>
                        <li class="treeview" shiro:hasPermission="costPaint:menu">
                            <a href="#">
                                <i class="fa fa-folder-open   text-yellow"></i>
                                <span>涂装工时确认单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li shiro:hasPermission="cost:Paint:view"><a th:href="@{/craft/cost/paint/create}"
                                                                             target="content"><i
                                        class="fa fa-pencil-square  text-fuchsia"></i> 涂装工时确认单录入</a></li>
                                <li shiro:hasPermission="cost:Painting:view"><a th:href="@{/craft/cost/paint/submit}"
                                                                                target="content"><i
                                        class="fa fa-bandcamp text-yellow"></i> 涂装工时确认单提交</a></li>
                                <li shiro:hasPermission="cost:PaintList:view"><a th:href="@{/craft/cost/paint/examine}"
                                                                                 target="content"><i
                                        class="fa fa-check-circle  text-lime"></i> 涂装工时确认单审核</a></li>
                            </ul>
                        </li>
                        <li class="treeview" shiro:hasPermission="costCarriage:menu">
                            <a href="#">
                                <i class="fa fa-folder-open   text-maroon"></i>
                                <span>包装运输确认单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li shiro:hasPermission="cost:wrapEntering:view"><a
                                        th:href="@{/craft/cost/transport/create}"
                                        target="content"><i class="fa fa-pencil-square  text-fuchsia"></i> 包装运输确认单录入</a>
                                </li>
                                <li shiro:hasPermission="cost:wrapSubmit:view"><a
                                        th:href="@{/craft/cost/transport/submit}"
                                        target="content"><i class="fa fa-bandcamp text-yellow"></i> 包装运输确认单提交</a></li>
                                <li shiro:hasPermission="cost:wrapCheck:view"><a
                                        th:href="@{/craft/cost/transport/examine}"
                                        target="content"><i class="fa fa-check-circle  text-lime"></i> 包装运输确认单审核</a>
                                </li>
                            </ul>
                        </li>
                        <li class="treeview">
                            <a href="#" shiro:hasPermission="costPainting:menu">
                                <i class="fa fa-folder-open   text-maroon"></i>
                                <span>安装工时确认单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li shiro:hasPermission="cost:install:view"><a th:href="@{/craft/cost/install/create}"
                                                                               target="content"><i
                                        class="fa fa-pencil-square  text-fuchsia"></i> 安装工时确认单录入</a></li>
                                <li shiro:hasPermission="cost:instPlan:view"><a th:href="@{/craft/cost/install/submit}"
                                                                                target="content"><i
                                        class="fa fa-bandcamp text-yellow"></i> 安装工时确认单提交</a></li>
                                <li shiro:hasPermission="cost:instalList:view"><a
                                        th:href="@{/craft/cost/install/examine}"
                                        target="content"><i class="fa fa-check-circle  text-lime"></i> 安装工时确认单审核</a>
                                </li>
                            </ul>
                        </li>

                        <li  class="treeview">
                            <a href="#" shiro:hasPermission="costMachining:menu">
                                <i class="fa fa-folder-open   text-blue"></i>
                                <span>机加工时确认单</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a th:href="@{/craft/cost/machining/create}" shiro:hasPermission="cost:machining:view" target="content">
                                        <i class="fa fa-i-cursor  text-fuchsia"></i>  机加工时确认单录入
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/machining/submit}" shiro:hasPermission="cost:machiningPlan:view" target="content">
                                        <i class="fa fa-cloud-upload text-fuchsia"></i>  机加工时确认单提交
                                    </a>
                                </li>
                                <li>
                                    <a th:href="@{/craft/cost/machining/examine}" shiro:hasPermission="cost:machiningList:view" target="content">
                                        <i class="fa fa-street-view  text-fuchsia"></i> 机加工时确认单审核
                                    </a>
                                </li>
                            </ul>
                        </li>

                        <!--<li shiro:hasPermission="cost:update:view"><a th:href="@{/craft/cost/update}" target="content"><i-->
                                <!--class="fa fa-search text-red"></i> 成本信息变更</a></li>-->

                        <li shiro:hasPermission="cost:Planquery:view"><a th:href="@{/craft/cost/query}"
                                                                         target="content"><i
                                class="fa fa-search text-red"></i> 成本信息输出查询</a></li>

                    </ul>
                </li>
                <!--领料申请管理-->
                <li shiro:hasPermission="req:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-green"></i>
                        <span>领料申请管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li shiro:hasPermission="req:create:view">
                            <a th:href="@{/materialRequisition/createPage}" target="content">
                                <i class="fa fa-table text-aqua"></i> 创建领料申请
                                <lable id="materialRequisitionCreateNum" class="label label-warning pull-right" style="display: none">0</lable>
                            </a>
                        </li>
                        <li shiro:hasPermission="req:submit:view">
                            <a th:href="@{/materialRequisition/submitPage}" target="content">
                                <i class="fa fa-list-ol text-lime"></i> 领料申请提交
                                <lable id="materialRequisitionSubmitNum" class="label label-warning pull-right" style="display: none">0</lable>
                            </a>
                        </li>
                        <li shiro:hasPermission="req:audit:view">
                            <a th:href="@{/materialRequisition/auditPage}" target="content">
                                <i class="fa fa-check-circle text-red"></i> 领料申请审核
                                <lable id="materialRequisitionAuditNum" class="label label-warning pull-right" style="display: none">0</lable>
                            </a>
                        </li>
                        <li shiro:hasPermission="req:query:view">
                            <a th:href="@{/materialRequisition/queryPage}" target="content">
                                <i class="fa fa-search text-green"></i> 领料申请查询
                            </a>
                        </li>
                    </ul>
                </li>
                <!--基础信息配置-->
                <li shiro:hasPermission="basic:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-orange"></i>
                        <span>基础信息配置</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{/task/planManage}" shiro:hasPermission="system:plan:view" target="content">
                                <i class="fa fa-users text-teal"></i> 计划信息管理
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/task/retManage}" shiro:hasPermission="system:plan:view" target="content">
                                <i class="fa fa-users text-teal"></i> 反馈信息管理
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/verify/orgConfig}" shiro:hasPermission="basic:orgConfig:view" target="content">
                                <i class="fa fa-th-large text-blue"></i> 审核组织架构配置
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/verify/verifyConfig}" shiro:hasPermission="basic:verifyConfig:view" target="content">
                                <i class="fa fa-th-large text-blue"></i> 审核流程配置
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/sys/dept}" shiro:hasPermission="system:dept:view" target="content">
                                <i class="fa fa-users text-teal"></i> 部门管理
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/sys/dict}" shiro:hasPermission="basic:dict:view" target="content">
                                <i class="fa fa-book text-bold"></i> 数据字典
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/sys/transdept}" shiro:hasPermission="system:transdept:view" target="content">
                                <i class="fa fa-users text-teal"></i> 生产部门
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/sys/transuser}" shiro:hasPermission="system:transuser:view" target="content">
                                <i class="fa fa-user-md text-teal"></i> 生产帐号
                            </a>
                        </li>
                    </ul>
                </li>
                <!--系统管理-->
                <li shiro:hasPermission="system:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-orange"></i>
                        <span>系统管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li>
                            <a th:href="@{/sys/user}" shiro:hasPermission="system:user:view" target="content">
                                <i class="fa fa-user-md text-teal"></i> 帐号管理
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/sys/role}" shiro:hasPermission="system:role:view" target="content">
                                <i class="fa fa-user-secret text-yellow"></i> 角色管理
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/sys/menu}" shiro:hasPermission="system:permission:view" target="content">
                                <i class="fa  fa-user-times text-blue"></i> 权限管理
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/sys/log}" shiro:hasPermission="system:log:view" target="content">
                                <i class="fa fa-file-text-o text-green"></i> 操作日志
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </section>
    </aside>

    <div class="content-wrapper">
        <iframe id="content" th:src="@{/overview/index}" scrolling="auto" frameborder="0" name="content" width="100%"
                height="100%"></iframe>
    </div>
</div>

<div th:include="include :: footer"></div>
<script th:inline="javascript">

    /** 如果首页不在最顶层， 将最顶层改为首页 */
    if (window.parent.window !== window) {
        window.top.location = ctx;
    }

    /** 修改iframe框架高度 */
    function changeFrameHeight() {
        var ifm = document.getElementById("content");
        ifm.height = document.documentElement.clientHeight - 56;
    }

    /** 窗口大小改变事件 */
    window.onresize = function () {
        changeFrameHeight();
    };

    // /** 获取下任务消息 */
    // function getSend() {
    //     $("#unread-send").html('');
    //     $("#count-send").html('');
    //     $("#no-send").show();
    //     js.get({
    //         url: ctx + "send",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-send").hide();
    //                 $("#count-send").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = ctx + "img/avatar.png";
    //                     $("#unread-send").append(`
    //                         <li><a class="message-send" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>系统通知<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }
    //
    // /** 获取下任务消息 */
    // function getChange() {
    //     $("#unread-change").html('');
    //     $("#count-change").html('');
    //     $("#no-change").show();
    //     js.get({
    //         url: ctx + "change",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-change").hide();
    //                 $("#count-change").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = ctx + "img/avatar.png";
    //                     $("#unread-change").append(`
    //                         <li><a class="message-change" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>系统通知<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }

    // /**
    //  * 获取互动消息
    //  */
    // function getInteractive() {
    //     $("#unread-interactive").html('');
    //     $("#count-interactive").html('');
    //     $("#no-interactive").show();
    //     js.get({
    //         url: ctx + "receiver",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-interactive").hide();
    //                 $("#count-interactive").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = v.sendUserImage == null ? (ctx + "img/avatar.png") : v.sendUserImage;
    //                     $("#unread-interactive").append(`
    //                         <li><a class="message-interactive" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>${v.sendUserName}<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }

    // /**控制菜单显示*/
    // function roleControllerMenu() {
    //     var roles = [[${roleCodes}]];
    //     $("#W01").hide();
    //     $("#W02").hide();
    //     $("#W03").hide();
    //     var wcount=0;
    //     for (var i = 0; i < roles.length; i++) {
    //         if (roles[i] == "W01") {
    //             $("#W01").show();
    //             wcount++;
    //         }else
    //         if (roles[i] == "W02") {
    //             $("#W02").show();
    //             wcount++;
    //         }else
    //         if (roles[i] == "W03") {
    //             $("#W03").show();
    //             wcount++;
    //         }
    //     }
    //     if(wcount==0){
    //         $("#W01").show();
    //         $("#W02").show();
    //         $("#W03").show();
    //     }
    //
    //
    // }

    $(function () {
        /** iframe 自动高度 */
        changeFrameHeight();
        prodTaskManPenItemPromptNum();
        setInterval(prodTaskManPenItemPromptNum,2333);
        /** 验证初始化 */
        js.validate.init("userForm", {
            fields: {
                pwd: {validators: {notEmpty: {message: '请输入密码'}}},
                rePwd: {
                    validators: {
                        notEmpty: {message: '请确认密码'},
                        identical: {field: 'pwd', message: '两次密码不一致'}
                    }
                }
            }
        });

        /** 修改密码 */
        $("#btn-updatePassword").click(function () {
            if (js.validate.isValid("userForm")) {
                js.post({
                    url: ctx + "update/user/pwd",
                    data: $("#userForm").serialize(),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.modal.hide("modal-updatePassword");
                        } else {
                            js.modal.warning(result.msg);
                        }
                    }
                });
            }
        });


        /** 菜单栏点击事件 */
        $(".treeview-menu>li").click(function () {
            $(".treeview-menu>li").removeClass("active");
            $(this).addClass("active");
        });

        // /** 初始化WebSocket */
        // js.ws.init({
        //     // url: "ws://192.168.72.158:8080/websocket",
        //     url: "ws://192.168.50.3:8081/websocket",
        //     handler: function (msg) {
        //         if (msg.data === "INTERACTIVE") {
        //             getInteractive();
        //         } else if (msg.data === "SEND") {
        //             getSend();
        //         } else if (msg.data === "CHANGE") {
        //             getChange();
        //         }
        //     }
        // });

        /** 获取互动消息 */
        // getInteractive();

        /** 获取下任务消息 */
        // getSend();

        /** 获取项目变更消息 */
        // getChange();

        // /** 互动消息点击 */
        // $(document).on('click', ".message-interactive", function () {
        //     var count = parseInt($("#count-interactive").text());
        //     if (count > 1) {
        //         $("#count-interactive").text(count - 1);
        //     } else {
        //         $("#count-interactive").text('');
        //     }
        //     $(this).parent().remove();
        // });

        // /** 下任务点击 */
        // $(document).on('click', ".message-send", function () {
        //     var count = parseInt($("#count-send").text());
        //     if (count > 1) {
        //         $("#count-send").text(count - 1);
        //     } else {
        //         $("#count-send").text('');
        //     }
        //     $(this).parent().remove();
        // });
        //
        // /** 下任务点击 */
        // $(document).on('click', ".message-change", function () {
        //     var count = parseInt($("#count-change").text());
        //     if (count > 1) {
        //         $("#count-change").text(count - 1);
        //     } else {
        //         $("#count-change").text('');
        //     }
        //     $(this).parent().remove();
        // });


        initCropperInModal($('#photo'), $('#photoInput'), $('#modal-upload'));
        initCropperInModalSign($('#signImg'), $('#signInput'), $('#modal-sign'));


    });

    var initCropperInModal = function (img, input, modal) {
        var $image = img;
        var $inputImage = input;
        var $modal = modal;
        var options = {
            aspectRatio: 1, // 纵横比
            viewMode: 2,
            preview: '.img-preview' // 预览图的class名
        };
        // 模态框隐藏后需要保存的数据对象
        var saveData = {};
        var URL = window.URL || window.webkitURL;
        var blobURL;
        $modal.on('show.bs.modal', function () {
            // 如果打开模态框时没有选择文件就点击“打开图片”按钮
            if (!$inputImage.val()) {
                $inputImage.click();
            }
        }).on('shown.bs.modal', function () {
            // 重新创建
            $image.cropper($.extend(options, {
                ready: function () {
                    // 当剪切界面就绪后，恢复数据
                    if (saveData.canvasData) {
                        $image.cropper('setCanvasData', saveData.canvasData);
                        $image.cropper('setCropBoxData', saveData.cropBoxData);
                    }
                }
            }));
        }).on('hidden.bs.modal', function () {
            // 保存相关数据
            saveData.cropBoxData = $image.cropper('getCropBoxData');
            saveData.canvasData = $image.cropper('getCanvasData');
            // 销毁并将图片保存在img标签
            $image.cropper('destroy').attr('src', blobURL);
        });
        if (URL) {
            $inputImage.change(function () {
                var files = this.files;
                var file;
                if (!$image.data('cropper')) {
                    return;
                }
                if (files && files.length) {
                    file = files[0];
                    if (/^image\/\w+$/.test(file.type)) {

                        if (blobURL) {
                            URL.revokeObjectURL(blobURL);
                        }
                        blobURL = URL.createObjectURL(file);

                        // 重置cropper，将图像替换
                        $image.cropper('reset').cropper('replace', blobURL);

                        // 选择文件后，显示和隐藏相关内容
                        $('.img-container').removeClass('hidden');
                        $('.img-preview-box').removeClass('hidden');
                        $('#btn-upload').removeAttr('disabled').removeClass('disabled');
                        $('.tip-info').addClass('hidden');

                    } else {
                        window.alert('请选择一个图像文件！');
                    }
                }
            });
        } else {
            $inputImage.prop('disabled', true).addClass('disabled');
        }
    }

    var initCropperInModalSign = function (img, input, modal) {
        var $image = img;
        var $inputImage = input;
        var $modal = modal;
        var options = {
            aspectRatio: 3 / 1, // 纵横比
            viewMode: 2/*,
    preview: '.img-preview' // 预览图的class名*/
        };
        // 模态框隐藏后需要保存的数据对象
        var saveData = {};
        var URL = window.URL || window.webkitURL;
        var blobURL;
        $modal.on('show.bs.modal', function () {
            // 如果打开模态框时没有选择文件就点击“打开图片”按钮
            if (!$inputImage.val()) {
                $inputImage.click();
            }
        }).on('shown.bs.modal', function () {
            // 重新创建
            $image.cropper($.extend(options, {
                ready: function () {
                    // 当剪切界面就绪后，恢复数据
                    if (saveData.canvasData) {
                        $image.cropper('setCanvasData', saveData.canvasData);
                        $image.cropper('setCropBoxData', saveData.cropBoxData);
                    }
                }
            }));
        }).on('hidden.bs.modal', function () {
            // 保存相关数据
            saveData.cropBoxData = $image.cropper('getCropBoxData');
            saveData.canvasData = $image.cropper('getCanvasData');
            // 销毁并将图片保存在img标签
            $image.cropper('destroy').attr('src', blobURL);
        });
        if (URL) {
            $inputImage.change(function () {
                var files = this.files;
                var file;
                if (!$image.data('cropper')) {
                    return;
                }
                if (files && files.length) {
                    file = files[0];
                    if (/^image\/\w+$/.test(file.type)) {

                        if (blobURL) {
                            URL.revokeObjectURL(blobURL);
                        }
                        blobURL = URL.createObjectURL(file);

                        // 重置cropper，将图像替换
                        $image.cropper('reset').cropper('replace', blobURL);

                        // 选择文件后，显示和隐藏相关内容
                        $('.sign-img-container').removeClass('hidden');
                        // $('.img-preview-box').removeClass('hidden');
                        $('#btn-sign').removeAttr('disabled').removeClass('disabled');
                        $('.sign-tip-info').addClass('hidden');

                    } else {
                        window.alert('请选择一个图像文件！');
                    }
                }
            });
        } else {
            $inputImage.prop('disabled', true).addClass('disabled');
        }
    }
    /**上传头像*/
    var sendPhoto = function () {
        var photo = $('#photo').cropper('getCroppedCanvas', {
            width: 300,
            height: 300
        }).toDataURL('image/png');

        $.post(ctx + "sys/user/edit/img", {imageData: photo}, function (result) {
            $('#userImage').attr('src', result.data);
            js.modal.hide("modal-upload");
        });
    }

    /**
     * 生产任务管理待处理项目数提示
     */
    function prodTaskManPenItemPromptNum(){
        $.post(ctx + 'prodOrd/getProdTaskManPenItemPromptNum',{},function(result){
            $("#prodOrdReleaseNum").text(result.data.prodOrdReleaseNum);
            if(parseInt(result.data.prodOrdReleaseNum)>0){
                $("#prodOrdReleaseNum").show();
            }else{
                $("#prodOrdReleaseNum").hide();
            }
            $("#schedulingNum").text(result.data.schedulingNum);
            if(parseInt(result.data.schedulingNum)>0){
                $("#schedulingNum").show();
            }else{
                $("#schedulingNum").hide();
            }
            $("#commonNum").text(result.data.commonNum);
            if(parseInt(result.data.commonNum)>0){
                $("#commonNum").show();
            }else{
                $("#commonNum").hide();
            }
            $("#auditNum").text(result.data.auditNum);
            if(parseInt(result.data.auditNum)>0){
                $("#auditNum").show();
            }else{
                $("#auditNum").hide();
            }
            $("#auditMinisterialNum").text(result.data.auditMinisterialNum);
            if(parseInt(result.data.auditMinisterialNum)>0){
                $("#auditMinisterialNum").show();
            }else{
                $("#auditMinisterialNum").hide();
            }
        });
    }
</script>
</body>
</html>
